package com.property.management.service.impl;

import java.util.List;
import com.property.common.utils.DateUtils;
import com.property.management.mapper.CourtInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.property.management.mapper.ResidentInfoMapper;
import com.property.management.domain.ResidentInfo;
import com.property.management.service.IResidentInfoService;
import com.property.common.core.text.Convert;

/**
 * 住户信息Service业务层处理
 * 
 * @author property
 * @date 2021-05-06
 */
@Service
public class ResidentInfoServiceImpl implements IResidentInfoService 
{
    @Autowired
    private ResidentInfoMapper residentInfoMapper;
    @Autowired
    private CourtInfoMapper courtInfoMapper;
    /**
     * 查询住户信息
     * 
     * @param id 住户信息ID
     * @return 住户信息
     */
    @Override
    public ResidentInfo selectResidentInfoById(Integer id)
    {
        return residentInfoMapper.selectResidentInfoById(id);
    }

    /**
     * 查询住户信息列表
     * 
     * @param residentInfo 住户信息
     * @return 住户信息
     */
    @Override
    public List<ResidentInfo> selectResidentInfoList(ResidentInfo residentInfo)
    {
        return residentInfoMapper.selectResidentInfoList(residentInfo);
    }

    /**
     * 新增住户信息
     * 
     * @param residentInfo 住户信息
     * @return 结果
     */
    @Override
    public int insertResidentInfo(ResidentInfo residentInfo)
    {
        residentInfo.setCreateTime(DateUtils.getNowDate());
        return residentInfoMapper.insertResidentInfo(residentInfo);
    }

    /**
     * 修改住户信息
     * 
     * @param residentInfo 住户信息
     * @return 结果
     */
    @Override
    public int updateResidentInfo(ResidentInfo residentInfo)
    {
        residentInfo.setUpdateTime(DateUtils.getNowDate());
        return residentInfoMapper.updateResidentInfo(residentInfo);
    }

    /**
     * 删除住户信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteResidentInfoByIds(String ids)
    {
        return residentInfoMapper.deleteResidentInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除住户信息信息
     * 
     * @param id 住户信息ID
     * @return 结果
     */
    @Override
    public int deleteResidentInfoById(Integer id)
    {
        return residentInfoMapper.deleteResidentInfoById(id);
    }
}
